﻿@model IEnumerable<TesisProj.Areas.Modelo.Models.Formula>

@{
    ViewBag.Title = "Fórmulas: " + ViewBag.Proyecto;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Fórmulas de @ViewBag.Elemento (@ViewBag.Proyecto)</h2>

<p>
    <br />
    <a class="btn btn-inverse" style="color: #E6F0F2"href="@Url.Action("CreateFormula", new { idElemento = ViewBag.ElementoId })"">
  	    <i class="icon-plus icon-white"></i>Nuevo
    </a>
    <a style="margin:5px"></a>
    <a class="btn btn-inverse" style="color: #E6F0F2;"href="@Url.Action("Programa", new {id = ViewBag.ElementoId })"">
  	    <i class="icon-film icon-white"></i>Ver resultados
    </a>
    <a style="margin:5px"></a>
    <a class="btn btn-inverse" style="color: #E6F0F2;"href="@Url.Action("VerParametros", new { id = ViewBag.ElementoId })"">
  	    <i class="icon-flag icon-white"></i>Parámetros
    </a>
    <a style="margin:5px"></a>
    <a class="btn btn-inverse" style="color: #E6F0F2"href="@Url.Action("Journal", "Proyecto", new { Area = "Modelo",id = ViewBag.IdProyecto   })"">
  			<i class="icon-arrow-left icon-white"></i>Regresar
    </a>
    <br /><br /> 
</p>
<table class="table table-hover table-striped table-bordered">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Nombre)
        </th>
        <th style="text-align: center">
            @Html.DisplayNameFor(model => model.Secuencia)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Referencia)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IdElemento)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IdTipoFormula)
        </th>
        <th style="text-align: center">
            @Html.DisplayNameFor(model => model.Visible)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Nombre)
        </td>
        <td style="text-align: center">
            @Html.DisplayFor(modelItem => item.Secuencia)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Referencia)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Elemento.Nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TipoFormula.Nombre)
        </td>
        <td style="text-align: center">
            @Html.DisplayFor(modelItem => item.Visible)
        </td>
        <td>
            @Html.ActionLink("Editar", "EditFormula", new { id=item.Id }) |
            @Html.ActionLink("Eliminar", "DeleteFormula", new { id=item.Id }, new { onclick="return DeleteConfirm()" })
        </td>
    </tr>
}

</table>

<p>
    <br />
    <a class="btn btn-inverse" style="color: #E6F0F2"href="@Url.Action("Journal", "Proyecto", new { Area = "Modelo",id = ViewBag.IdProyecto   })"">
  	    <i class="icon-arrow-left icon-white"></i>Regresar
    </a>
</p>

<script>
    function DeleteConfirm(){
        if (confirm("¿Está seguro que desea eliminar el registro?"))
            return true;
        else
            return false;     
    }
</script>